<template>
  <div>
    <!-- 物料表格 -->
    <div class="tableMain">
      <el-table :data="tableData" stripe style="width: 100%">
        <el-table-column type="index" label="#" width="25"></el-table-column>
        <el-table-column prop="barCode" label="商品条码" align="center" width="200"></el-table-column>
        <el-table-column prop="name" label="商品" align="center" width="200"></el-table-column>
        <el-table-column prop="goodsUnit" label="单位" align="center" width="200"></el-table-column>
        <el-table-column prop="purchaseNum" label="数量" align="center"></el-table-column>
        <el-table-column prop="goodsPrice" label="单价" align="center"></el-table-column>
        <el-table-column prop="goodsAmount" label="总价" align="center">
          <template slot-scope="scope">
            <span>{{(Number(scope.row.goodsPrice)*Number(scope.row.purchaseNum)).toFixed(2)}}</span>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    tableData: {
      type: Array,
      required: true
    }
  }
}
</script>
